package torres.ability; 

import torres.entity.Statistic;
import torres.fileIO.BasicContainer;
import torres.fileIO.ClassContainer;
import torres.fileIO.Saveable;

/**
 * @author Torres
 * Cost of the execution of an Ability
 */
public class Cost implements Saveable {
	private Statistic stat;
	private double cost;
	
	/**
	 * Creates a new Cost with given statistic and cost
	 * @param stat Kinds of costs
	 * @param cost Value of cost
	 */
	public Cost(Statistic stat, double cost) {
		
		this.stat = stat;
		this.cost = cost;
	}
	
	/**
	 * Sets the value of cost of Cost
	 * @param cost the new cost to set
	 */
	public void setCost(double cost) {
		
		this.cost = cost;
	}
	
	/**
	 * returns the value of cost of Cost
	 * @return the value of cost returned
	 */
	public double getCost() {
		
		return cost;
	}
	
	/**
	 * Sets the types of Cost
	 * @param stat the new statistic to set
	 */
	public void setStat(Statistic stat) {
		
		this.stat = stat;
	}
	
	/**
	 * Returns the types of Cost
	 * @return statistic of Cost
	 */
	public Statistic getStat() {
		return stat;
	}
	
	/**
	 * Save function for Cost for Save/Load.
	 * @see torres.fileIO.Saveable#save()
	 */
	@Override
	public ClassContainer save() {
		
		ClassContainer curClass = new ClassContainer("Cost");
		curClass.addProperty(new BasicContainer("stat", stat));
		curClass.addProperty(new BasicContainer("cost", cost));
		
		return curClass;
	}
	
	/**
	 * Load function for Cost for Save/Load.
	 * @see torres.fileIO.Saveable#load(torres.fileIO.ClassContainer)
	 */
	@Override
	public void load(ClassContainer classContainer) {
		
		// TODO Auto-generated method stub
		
	}
}
